<?php
namespace Home\Model;
use Think\Model;
class FeedbackModel extends Model{
	protected $_validate = array(
		array('name','require','姓名不能为空！'), //默认情况下用正则进行验证
		array('phone','require','电话不能为空！'),
		array('phone','/^(0?1[358]\d{9})$|^((0(10|2[1-3]|[3-9]\d{2}))?[1-9]\d{6,7})$/','电话格式错误！',2,),
		array('email','require','邮箱不能为空！'),
		array('email','email','Email格式错误！',2),		
		array('content','require','内容不能为空！',1,'',1), //默认情况下用正则进行验证
	);
    protected $_auto = array (
		array('add_time','getDate',3,'callback'),
    );
	function getDate(){
		return date('Y-m-d H:i:s');
	}
}